import allure
from appium.webdriver.common.appiumby import AppiumBy

from .base import Base


class Search_engine_results_page(Base):     # 搜索结果页
    # 股票价格
    __SHARE_PRICE = (AppiumBy.ID, 'com.xueqiu.android:id/current_price_dtv')

    def get_share_price(self, img_name):
        with allure.step("获取搜索结果的股票价格"):
            price = self.find_text(self.__SHARE_PRICE)
            self.img_log(img_name, "搜索结果")
            return price
